Programming iOS 11 by Matt Neuburg

Programming iOS 11 by Matt Neuburg

Author:Matt Neuburg
Language: eng
Format: epub, pdf
Publisher: O'Reilly Media
Published: 2017-12-22T05:00:00+00:00


override var collectionViewContentSize : CGSize { return self.sz } override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { return Array(self.atts.values) } override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { return self.atts[indexPath] }

Finally, I want to implement shouldInvalidateLayout(forBoundsChange:) to return true, so that if the interface is rotated, my prepareLayout will be called again to recalculate the grid. There’s a potential source of inefficiency here, though: the user scrolling the collection view counts as a bounds change as well. Therefore, I return false unless the bounds width has changed:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.